{% extends "base2.html" %}

{% block title %}Login{% endblock %}

{% block template_js %}
<script type="text/javascript" src="{{ STATIC_URL }}js/login.js"></script>
{% endblock %}

{% block conteudo %}

{% if form.errors %}
<p class="alert alert-danger">Usuário e/ou senha inválido(s).</p>
{% endif %}

{% if mensagem %}
<p id="mensagem">{{ mensagem }}</p>
{% endif %}

{% if aviso %}
<p id="aviso">{{ aviso }}</p>
{% endif %}

<form action="{% url 'django.contrib.auth.views.login' %}" method="post" class="navbar-form text-center" >
    {% csrf_token %}
    <input type="hidden" name="next" value="{{ next }}" />
    <h4>Por favor, autentique-se</h4>
    <div class="form-group">
        <div class="input-group">
            <span class="input-group-addon glyphicon glyphicon-user"></span>
            <input id="id_username" type="text" class="form-control" name="username" {% if form.username.value %}value="{{ form.username.value }}"{% endif %} required autocomplete="off" placeholder="Login" autofocus />
            <span class="input-group-addon glyphicon glyphicon-lock"></span>
            <input type="password" class="form-control" name="password" required autocomplete="off" placeholder="Senha" />
        </div>
    </div>
    <button type="submit" class="btn btn-primary">Entrar</button>
</form>

{% endblock %}
